home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / programming / other / mesa / mesa-glut / src-glut.aos / glutchangetomenusubentry.c < prev    next >
C/C++ Source or Header  |  2000-02-23  |  2KB  |  67 lines

  1. /*
  2.  * Amiga GLUT graphics library toolkit
  3.  * Version:  1.1
  4.  * Copyright (C) 1998 Jarno van der Linden
  5.  *
  6.  * This library is free software; you can redistribute it and/or
  7.  * modify it under the terms of the GNU Library General Public
  8.  * License as published by the Free Software Foundation; either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * This library is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.  * Library General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU Library General Public
  17.  * License along with this library; if not, write to the Free
  18.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  */
  20.  
  21. /*
  22.  * glutChangeToMenuSubEntry.c
  23.  *
  24.  * Version 1.0  27 Jun 1998
  25.  * by Jarno van der Linden
  26.  * jarno@kcbbs.gen.nz
  27.  *
  28.  */
  29.  
  30. #include "glutstuff.h"
  31.  
  32. void glutChangeToMenuEntry(int entry, const char *name, int value)
  33. {
  34.   struct GlutMenuEntry *gme;
  35.  
  36.   if (glutstuff.curmenu) {
  37.     if((gme = stuffGetMenuEntry(entry, glutstuff.curmenu))) {
  38.       gme->name = name;
  39.       gme->EntryValue = value;
  40.       gme->issubmenu = FALSE;
  41.       gme->EntryMenu = 0;
  42.  
  43.       glutstuff.curmenu->needupdate = TRUE;
  44.     }
  45.     else
  46.       DEBUGOUT(1, "somethings wrong in glutChangeToMenuEntry(%d, %s, %d)\n", entry, name, value);
  47.   }
  48. }
  49.  
  50. void glutChangeToSubMenu(int entry, const char *name, int menu)
  51. {
  52.   struct GlutMenuEntry *gme;
  53.  
  54.   if (glutstuff.curmenu) {
  55.     if ((gme = stuffGetMenuEntry(entry, glutstuff.curmenu))) {
  56.       gme->name = name;
  57.       gme->EntryValue = menu;
  58.       gme->issubmenu = TRUE;
  59.       gme->EntryMenu = stuffGetMenu(menu);
  60.  
  61.       glutstuff.curmenu->needupdate = TRUE;
  62.     }
  63.     else
  64.       DEBUGOUT(1, "somethings wrong in glutChangeToSubMenu(%d, %s, %d)\n", entry, name, menu);
  65.   }
  66. }
  67.